<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录界面</title>
<link rel="stylesheet" type="text/css" href="css/yy.css">
<script type="text/javascript">
function validate(){
	if(form.username.value==""){
		alert("用户名不能为空");	
		return false;
	}
	if(form.username.value.indexOf(",")>-1||form.username.value.indexOf("，")>-1){
		alert("用户名不能包含逗号");	
		return false;
	}
	if(form.password.value==""){
		alert("密码不能为空");	
		return false;
	}
}
</script>
</head>
<body>
    <center>
        <form action="login"  method="post" onsubmit="return validate()" name="form">
        <h2 style="color:pink">用户登录</h2>
        <div class="login">
                                用户名:<input name="username"><br>
                                密码:<input type="password" name="password"><br>
         <input type="submit" value="登录">
         <input type="button" value="注册" onclick="window.location.href='register.html';">
        </div>
        </form>
    </center>
</body>
</html>